import {
	computed,
	onMounted,
	onUnmounted,
	reactive,
	ref,
	toRaw,
	watch,
} from "vue";

export default function(arg) {
	const { api } = arg

	const 删 = (id, 后处理) => {
		console.log('id: ', id);
		uni.showModal({
			content: '确定，要删除么？',
			confirmColor: '#27BA9B',
			success: async (res) => {
				if (res.confirm) {
					const res = await api.删({ id })
					if (res.code == 0) {
						if (后处理) {
							后处理()
						}
					} else {
						console.log('删 出错了 res: ', res);
					}
				}
			},
		})
	}

	return {
		删
	}
}